#ifndef FND_GAME_2D_MESSAGE_HPP
#define FND_GAME_2D_MESSAGE_HPP
#include <boost/any.hpp>
namespace FndGame2D {
  template<typename Sender, typename Receiver,
	   typename MessageType>
  struct message {
    Sender sender ;
    Receiver receiver ;
    float action_time ;
    MessageType msg ;
    boost::any param ;
    message(Sender s,
	    Receiver r,
	    float t,
	    MessageType m) :
      sender(s),
      receiver(r),
      action_time(t),
      msg(m)
    {}
template<typename Param>
message(Sender s, Receiver r,
	float f, MessageType t, Param p) :
  sender(s),
  receiver(r),
  action_time(f),
  msg(t),
  param(p)
    {}
  } ;
  template<typename Sender, typename Receiver,
	   typename MessageType> message<Sender, Receiver, MessageType>
  make_message(Sender sender, Receiver receiver, float action_time, MessageType msg) {
    return message<Sender, Receiver, MessageType>(sender, receiver, action_time, msg) ;
  }

  template<typename Sender, typename Receiver,
	   typename MessageType, typename Param> message<Sender, Receiver, MessageType>
  make_message(Sender s, Receiver r, float a, MessageType m, Param p) {
    return message<Sender, Receiver, MessageType>(s,r,a,m,p) ;
  }


  template<typename Sender, typename Receiver, typename MessageType>
  bool operator > (const message<Sender, Receiver, MessageType>& msg1,
		   const message<Sender, Receiver, MessageType>& msg2) {
    return msg1.action_time > msg2.action_time ;
  }

  template<typename Sender, typename Receiver, typename MessageType>
  bool operator < (const message<Sender, Receiver, MessageType>& msg1,
		   const message<Sender, Receiver, MessageType>& msg2) {
    return msg1.action_time < msg2.action_time ;
  }

  typedef message<std::string, std::string, std::string> normal_thinker_message_type ;

}
#endif
